<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <script src="dist/echarts.min.js"></script>

<body>

    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            overflow: hidden;
        }

        #main {
            width: 80%;
            height: 90%;
            background: rgba(0, 0, 0, 0);
        }
    </style>

    <div id="main"></div>

    <script type="text/javascript">
        var myChart = echarts.init(document.getElementById('main'));
        var option;

        myChart.showLoading({

            text: 'Wait Loading Chart',
            color: '#ff33cc',
            textColor: '#fff',
            maskColor: 'rgba(0,0,0,0)',
            zlevel: 5,

        });

        var ctype = 'bar';
        var items = new Array();
        var values = new Array();

        var floatI100 = false;

        function SetValue() {

            ue.obj.setchartitem().then(function (ReturnValue) {
                items = ReturnValue;
            });

            ue.obj.setchartvalue().then(function (ReturnValue) {
                values = ReturnValue;
            });

            ue.obj.setcharttype().then(function (ReturnValue) {
                ctype = ReturnValue;
            });

            ue.obj.setcharfloati100().then(function (ReturnValue) {
                floatI100 = ReturnValue;
            });

            if (floatI100) {

                for (let i = 0; i < values.length; i++) {
                    var ix = values[i] / 100;
                    values[i] = ix;
                }
            }

        }

        function SetOption() {


            option = {
                tooltip: {},

                grid: {
                    left: '0%',
                    top: '15%',
                    right: '0%',
                    bottom: '10%',
                    containLabel: true
                },

                xAxis: {

                    data: items
                },
                yAxis: {},
                series: [{

                    type: ctype,
                    data: values

                }
                ]
            };


        }

        setInterval(function () {
            SetValue();
            SetOption();

            myChart.setOption(option);
            myChart.hideLoading();

            window.addEventListener("resize", function () {
                myChart.resize();
            })

        }, 1000);


    </script>

</body>

</head>